<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* h1 {
            background-image: -webkit-linear-gradient(90deg, blue, green);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        } */
        h1 {
            background-image: -webkit-linear-gradient(top, rgb(4, 94, 170),rgb(1, 152, 216));
            -webkit-background-clip: text; /*必需加前缀 -webkit- 才支持这个text值 */
            -webkit-text-fill-color: transparent; /*text-fill-color会覆盖color所定义的字体颜色： */
        }
    </style>
</head>
<body>
    <h1>文字渐变色</h1>
</body>
</html>